import _config


class BaseConfig:
    def __init__(self):

        self.logcat = "console"
        self.port = None

    def GetConsoleLog(self):
        """
        初始化
        :return:
        """
        from Util._console_log import ConsoleLog
        return ConsoleLog(self)

    def GetPort(self):
        if self.port == "sisdef": return _config.sister_port
        if self.port == "oneedef": return _config.onneesama_port
        return self.port


class SisterBaseConfig(BaseConfig):
    def __init__(self):
        super().__init__()
        self.port = "sisdef"
        self.bufsize = 1024 ** 3  # 默认最大传输大小是 1MB


class OneesamaBaseConfig(BaseConfig):
    def __init__(self):
        super().__init__()
        self.port = "oneedef"
        self.sisters = []
